cmake_minimum_required(VERSION 3.0.2)
project(TopicsTest)

ADD_COMPILE_OPTIONS(-std=c++14 )
set( CMAKE_CXX_FLAGS "-std=c++14 -O3" )

add_definitions(-DROOT_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\")


find_package(catkin REQUIRED COMPONENTS
  nav_msgs
  geometry_msgs
  roscpp
  rospy
  sensor_msgs
  std_msgs
  tf
  rosbag
  message_generation
  unitree_legged_msgs
)

find_package(GeographicLib REQUIRED)
find_package(Eigen3)
find_package(PCL REQUIRED)
find_package(yaml-cpp REQUIRED)


catkin_package(
  INCLUDE_DIRS include
#  LIBRARIES TopicsTest
  CATKIN_DEPENDS 
  roscpp 
  rospy
  std_msgs
  nav_msgs
  geometry_msgs
  sensor_msgs
  message_runtime 
  message_generation
#  DEPENDS system_lib
)


include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

include_directories(${GeographicLib_INCLUDE_DIRS})
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${Eigen_INCLUDE_DIRS})





add_executable(saveTopicsMsg src/saveTopicsMsg.cpp)
target_link_libraries(saveTopicsMsg ${catkin_LIBRARIES})

add_executable(processTopicsMsg src/processTopicsMsg.cpp)
target_link_libraries(processTopicsMsg ${catkin_LIBRARIES})

add_executable(rosbagProcess src/rosbagProcess.cpp)
target_link_libraries(rosbagProcess ${catkin_LIBRARIES})

add_executable(bag2bagProcess src/bag2bagProcess.cpp)
target_link_libraries(bag2bagProcess ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(recordPath2TUM src/recordPath2TUM.cpp)
target_link_libraries(recordPath2TUM ${catkin_LIBRARIES} ${GeographicLib_LIBRARIES})

add_executable(alignPath2GNSS src/alignPath2GNSS.cpp)
target_link_libraries(alignPath2GNSS ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(X20dataReceiver src/X20dataReceiver.cpp)
target_link_libraries(X20dataReceiver ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(imuOdom src/imuOdom.cpp)
target_link_libraries(imuOdom ${catkin_LIBRARIES})

add_executable(X20ContactModule src/X20ContactModule.cpp)
target_link_libraries(X20ContactModule ${catkin_LIBRARIES} ${PCL_LIBRARIES})

add_executable(A1Msg2jointState src/A1Msg2jointState.cpp)
target_link_libraries(A1Msg2jointState ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(saveOdom2TUM src/saveOdom2TUM.cpp)
target_link_libraries(saveOdom2TUM ${catkin_LIBRARIES} ${GeographicLib_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(savePath2TUM src/savePath2TUM.cpp)
target_link_libraries(savePath2TUM ${catkin_LIBRARIES} ${GeographicLib_LIBRARIES} ${YAML_CPP_LIBRARIES})

add_executable(JointMsg2A1Msg src/JointMsg2A1Msg.cpp)
target_link_libraries(JointMsg2A1Msg ${catkin_LIBRARIES} ${YAML_CPP_LIBRARIES})